import { Tag } from '@douyinfe/semi-ui';
import { ColumnProps } from '@douyinfe/semi-ui/lib/es/table';
import { pointTypes } from '../integral-helper';

const BaseColumns: ColumnProps[] = [
  {
    title: '人员姓名',
    dataIndex: 'userVo.name',
    width: 150,
  },
  {
    title: '所属企业',
    dataIndex: 'userVo.corporation',
    width: 250,
  },
  {
    title: '积分名称',
    dataIndex: 'title',
  },
  {
    title: '积分数',
    dataIndex: 'point',
    render: (text: any, record: any) => {
      return (
        <div className='flex items-center'>
          <span>{record?.confirmPoint ?? text}</span>
          {/* {record?.confirmPoint && (
            <Tag size='small' className='ml-2'>
              已修改
            </Tag>
          )} */}
        </div>
      );
    },
  },
  {
    title: '积分类型',
    dataIndex: 'pointTypeEnum',
    render: (text: any) => {
      return (
        // @ts-ignore
        <Tag size='large' color={pointTypes[text]?.color}>
          {/* @ts-ignore */}
          {pointTypes[text]?.text}
        </Tag>
      );
    },
  },
];

export default BaseColumns;
